<template>
  <div class="view" id="login_footer" style="width: 320px;height: 340px;float: bottom">
    <el-form :model="loginForm" label-width="70px" :rules="loginRules" ref="loginForm">
      <el-form-item>
        <el-button class="back_btn_mobile">手机找回</el-button>
        <el-button class="back_btn_email">邮箱找回</el-button>
      </el-form-item>
      <el-form-item label="用户名" prop="username">
        <el-input v-model="loginForm.username"></el-input>
      </el-form-item>
    </el-form>
    <div style="width: 300px;height: 40px" class="div-code-position">
      <el-form class="el-form-code" label-width="70px">
        <el-form-item label="验证码" prop="validationCode">
          <el-input class="validation_code" v-model="loginForm.validationCode"></el-input>
        </el-form-item>
        <img class="validation_code_img" src="@/assets/image/bmob.png">
      </el-form>
    </div>
    <div style="width: 300px;height: 40px" class="div-code-position">
      <el-form class="el-form-code" label-width="70px">
        <el-form-item label="校验码" prop="checkCode">
          <el-input class="validation_code" v-model="loginForm.checkCode"></el-input>
        </el-form-item>
        <button class="validation_code_btn">获取验证码</button>
        <!--        <el-button >获取验证码</el-button>-->
      </el-form>
    </div>
    <el-button class="login_btn_action" type="primary" @click="resetAction">重置密码</el-button>

  </div>

</template>

<script>
  export default {
    name: "ForgetPassword",
    created() {
    },
    data() {
      return {
        //这是登录表单的数据绑定对象
        loginForm: {
          username: 'admin',
          password: '312',
          validationCode: 'bmob',
          checkCode: "123456"
        },
        //这是表单的验证规则对象
        loginRules: {
          username: [{required: true, message: '请输入邮箱地址', trigger: 'blur'},
            {type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change']}
          ],
          password: [{required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 8, max: 16, message: '长度在 6 到 16 个字符', trigger: 'blur'}],
          code: [{required: true, message: '验证码不能为空', trigger: 'blur'},
            {min: 4, max: 6, message: '长度在 4 到 6 个字符', trigger: 'blur'}]
        }
      };

    },
    methods: {

      registerdAction() {
        this.$router.push("/registerd")
      },
      resetAction() {
        this.$router.push("/forgetPassword")
      }
    }

  }
</script>

<style scoped>
  #header {
    height: 50px;
    word-wrap: break-word;
    word-break: normal;
    background-color: #8c939d;
  }

  .back_btn_mobile, .back_btn_email {
    padding: 7px 17px;
  }

  .el-form {
    margin-top: 25px;
    margin-right: 30px;
  }

  .validation_code {
    float: right;
    /*padding: 5px 40px ;*/
    /*margin-right: 100px;*/
  }

  .div-code-position {
    position: relative;
  }

  .el-form-code {
    /*position: relative;*/
    width: 200px;

  }

  .validation_code_img, .validation_code_btn {
    position: absolute;
    top: 10px;
    right: 15px;
    float: right;
    width: 80px;
  }

  .validation_code_btn {
    padding: 10px 2px;
    margin-top: -8px;
  }


</style>

